#pragma once

class FileItem
{
public:
	FileItem(const CString& fileName, const CString& pathName);

	inline bool IsGetData() const;
	inline bool IsDataVaild() const;
	bool GetData();

	CString	strFileName;
	CString strPathName;
	ULONGLONG fileSize;
	CTime lastWriteTime;
	int iconIndex;

	static inline bool CompareFileItemName(FileItem* const lhs,FileItem* const rhs);
	static inline bool CompareFileItemSize(FileItem* const lhs,FileItem* const rhs);
	static inline bool CompareFileItemPath(FileItem* const lhs,FileItem* const rhs);
	static inline bool CompareFileItemTime(FileItem* const lhs,FileItem* const rhs);
	static inline bool CompareFileItemNameGT(FileItem* const lhs,FileItem* const rhs);
	static inline bool CompareFileItemSizeGT(FileItem* const lhs,FileItem* const rhs);
	static inline bool CompareFileItemPathGT(FileItem* const lhs,FileItem* const rhs);
	static inline bool CompareFileItemTimeGT(FileItem* const lhs,FileItem* const rhs);
private:
	bool isGetData,isDataVaild;
	void CopyItem(const FileItem& rhs);
	FileItem(const FileItem& rhs);
	FileItem& operator=(const FileItem& rhs);
};

bool FileItem::IsGetData() const
{
	return isGetData;
}

bool FileItem::IsDataVaild() const
{
	return isDataVaild;
}

inline bool FileItem::CompareFileItemName(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->strFileName.CollateNoCase(rhs->strFileName) < 0; 
}

inline bool FileItem::CompareFileItemSize(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->fileSize < rhs->fileSize; 
}

inline bool FileItem::CompareFileItemPath(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->strPathName.CollateNoCase(rhs->strPathName) < 0;
}

inline bool FileItem::CompareFileItemTime(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->lastWriteTime < rhs->lastWriteTime; 
}

inline bool FileItem::CompareFileItemNameGT(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->strFileName.CollateNoCase(rhs->strFileName) > 0; 
}

inline bool FileItem::CompareFileItemSizeGT(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->fileSize > rhs->fileSize; 
}

inline bool FileItem::CompareFileItemPathGT(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->strPathName.CollateNoCase(rhs->strPathName) > 0;
}

inline bool FileItem::CompareFileItemTimeGT(FileItem* const lhs,FileItem* const rhs)
{
	return lhs->lastWriteTime > rhs->lastWriteTime; 
}